function Accury_struct=cacul_accury(stego_cover,tamper_stego,detetion_img)
%UNTITLED3 此处显示有关此函数的摘要
%   detetion_img 检测的篡改位置
% load module_glass.mat
[col,raw]=size(detetion_img);
Accury_struct=struct('FP',0,'FN',0,'TP',0,'TN',0,'FPR',0,'FNR',0,'TPR',0,'P',0,'N',0,'Accuracy',0,'Precision',0,'MCC',0,'F1Score',0);
Z=abs(stego_cover-tamper_stego);%位置值=篡改位置，已验证
% [col_1 raw_1]=find(Z~=0);
% [col_2 raw_2]=find(module_glass~=0);
% [col_3 raw_3]=find(detetion_img~=0);
for i=1:col
   for j=1:raw
      if Z(i,j)>0.01 %真实的篡改的位置
         if detetion_img(i,j)~=0 %检测到篡改
             Accury_struct.TP=Accury_struct.TP+1;
         else%没有被检测到篡改
             Accury_struct.FN=Accury_struct.FN+1;
         end
      else %真实的未被篡改的位置
         if detetion_img(i,j)~=0 %检测到篡改
             Accury_struct.FP=Accury_struct.FP+1;
         else
             Accury_struct.TN=Accury_struct.TN+1;
         end
      end
   end
end
Accury_struct.FPR=Accury_struct.FP/(Accury_struct.FP+Accury_struct.TN);
Accury_struct.FNR=Accury_struct.FN/(Accury_struct.FN+Accury_struct.TP);
Accury_struct.TPR=Accury_struct.TP/(Accury_struct.FN+Accury_struct.TP);
Accury_struct.F1Score=2*Accury_struct.TP/(2*Accury_struct.TP+Accury_struct.FP+Accury_struct.FN);
Accury_struct.P=Accury_struct.TP+Accury_struct.FN;
Accury_struct.N=Accury_struct.TN+Accury_struct.FP;
Accury_struct.Accuracy=(Accury_struct.TP+Accury_struct.TN)/(Accury_struct.FP+Accury_struct.FN+Accury_struct.TP+Accury_struct.TN);
Accury_struct.Precision=Accury_struct.TP/(Accury_struct.TP+Accury_struct.FP);
Accury_struct.MCC=(Accury_struct.TP*Accury_struct.TN-Accury_struct.FP*Accury_struct.FN)/sqrt((Accury_struct.TP+Accury_struct.FP)*(Accury_struct.TP+Accury_struct.FN)*(Accury_struct.TN+Accury_struct.FP)*(Accury_struct.TN+Accury_struct.FN));
end



